<%@ page import="com.zs.dao.AdminDao" %>
<%@ page import="com.zs.entity.Admin" %><%--
  Created by IntelliJ IDEA.
  User: chongge
  Date: 2024/1/11
  Time: 18:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script src="/js/util.js" type="text/javascript" charset="UTF-8"></script>
<body>
<%
    int id =  Integer.parseInt(request.getParameter("id"));
    AdminDao adminDao = new AdminDao();
    Admin admin = adminDao.getAdminById(id);
%>
<form action="adminUpdate_action.jsp" onsubmit="return checkForm()">
    <input type="hidden" name="id" value="<%=admin.getId()%>">
    姓名:<input type="text" name="aname" id="aname"  autocomplete="off" value="<%=admin.getAname()%>"><br>
    密码:<input type="password" name="apwd" id="apwd"  value="<%=admin.getApwd()%>"><br>
    手机:<input type="text" name="phone" id="phone"  value="<%=admin.getPhone()%>"><br>
    邮箱:<input type="text" name="email" id="email"  value="<%=admin.getEmail()%>"><br>
    <input type="submit" value="确认修改">
</form>
<script>
    //添加非空验证功能
    function checkForm(){
        var aname = $("aname").value;
        var apwd = $("apwd").value;
        var phone = $("phone").value;
        var email = $("email").value;
        if (aname==""||apwd==""||phone==""||email==""){
            alert('文本框内不可为空,请重新输入!');
            return false;
        }
        return true;
    }
</script>
</body>
</html>
